#ifndef __EKF_INTR_I_H__
#define __EKF_INTR_I_H__

int intr_init(void);
int intr_init_ap(void);

#define IDT_COUNT       256
#define ISR_COUNT       32

/* The system level function prototype of irq interrupt handler */
typedef int(*irq_handler_f)(struct trapframe_s*);
/* and for exception handler */
typedef void(*ex_handler_f)(struct trapframe_s*);

/* syscall handler */
typedef void(*sys_handler_f)(uint32_t ret);


/* Set handler for responding interrupt */
void intr_ex_handler_set(uint32_t n, ex_handler_f h);
void intr_irq_handler_set(uint32_t irq, irq_handler_f h);
void intr_sys_handler_set(sys_handler_f h);

void intr_irq_eoi(int irq);

void intr_irq_line_enable(int irq);
void intr_irq_line_disable(int irq);

int  intr_timer_set(uint32_t freq);

int  intr_trap_from_user(struct trapframe_s *tf);


#endif
